# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=beautifulsoup3
pkgbase=mingw-w64-python2-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}")
pkgver=3.2.1
pkgrel=2
pkgdesc="A Python HTML/XML parser designed for quick turnaround projects like screen-scraping (mingw-w64)"
arch=('any')
license=('PSF')
url="https://www.crummy.com/software/BeautifulSoup/index.html"
depends=("${MINGW_PACKAGE_PREFIX}-python2")
source=(https://www.crummy.com/software/BeautifulSoup/download/3.x/BeautifulSoup-${pkgver}.tar.gz)
sha256sums=('f5ba85e907e7dfd78e44e4000b3eaef3a650aefc57831e8a645702db2e5b50db')

prepare() {
  cd "${srcdir}/BeautifulSoup-${pkgver}"
}

build() {
  cd "${srcdir}/BeautifulSoup-${pkgver}"
  ${MINGW_PREFIX}/bin/python2 setup.py build
}

package() {
  cd "${srcdir}/BeautifulSoup-${pkgver}"
  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=;--install-purelib=;--install-data=" \
    ${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}" --optimize=1
}
